import {EnumDataType} from './EnumDv';
import {merge} from 'lodash';

export const chartBasicConfig: DV.IAdvanceConfig = {
  isHidden: false, // 是否隐藏组件
  option: {}
  // shadowBlur: '',
  // chartZoom: {
  //   open: true,
  //   chartSize: '',
  //   centering: '',
  //   dialogSize: ''
  // },
  // icon: '',
  // fontSize: 12,
  // isLock: false,
  // isHidden: false,
  // hideLoading: false
}

export const dataConfig: DV.IDataConfig = {
  dataType: EnumDataType.static.type,
  dataModelHash: '',
  dataApiUrl: '',
  continuity_type: '',
  continuity_time_step: '',
  continuity_empty_val: '',
  data: '',
  needAutoRefresh: false,
  autoRefreshInterval: 0, // 数据更新频率/ms
}

export const getBasicChartOptions = (configTemp: DV.IAdvanceConfig) => (merge({
  // 通用配置
  name: '',
  remark: '',
  uid: '',
  left: 0,
  top: 0,
  width: 0,
  height: 0,
  zIndex: 10,
  opacity: 1,
  rotate: 0,
  overflowHidden: true,
  isMount: false, // 是否挂载组件
  type: '',
  frameType: '',
  className: '',
  mask: false, // 遮罩层
  //  默认配置 + 高级配置
  config: chartBasicConfig,
  // 数据
  dataConfig: dataConfig,
  codeConfig: {
    code: ''
  },
  events: {},
}, {config: configTemp}))
